package com.jiyun.service.impl;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.comonm.R;
import com.jiyun.mapper.UserMapper;
import com.jiyun.pojo.XUser;
import com.jiyun.service.UserService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
public class IUserService extends ServiceImpl<UserMapper, XUser> implements UserService {
    @Resource
    UserMapper userMapper;
    @Resource
    RedisTemplate redisTemplate;


    @Override
    public Map<String, Object> getUserInfo(String token) {
        Object o = redisTemplate.opsForValue().get(token);
        if (o != null){
           XUser login=JSON.parseObject(JSON.toJSONString(o),XUser.class);
            HashMap<String, Object> hash = new HashMap<>();

        }
        return null;
    }
}
